package com.nuaa.ojjudgecodesandbox.security;

import java.io.FileDescriptor;
import java.security.Permission;

/**
 * @Author ortonzhu
 * @Date 2024/10/21 9:45
 */
public class MySecurityManager extends SecurityManager {

    @Override
    public void checkPermission(Permission perm) {
        super.checkPermission(perm);
    }

    @Override
    public void checkRead(String file) {
        throw new SecurityException("read not allowed");
    }


    @Override
    public void checkDelete(String file) {
        throw new SecurityException("delete not allowed");
    }


    @Override
    public void checkConnect(String host, int port) {
        throw new SecurityException("connect not allowed" + host + ":" + port);
    }

    @Override
    public void checkExec(String cmd) {
        throw new SecurityException("exec not allowed");

    }
}
